#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
int is_levoduct(char* s1,char* s2)
{
	int len = strlen(s1);
	int len2 = strlen(s2);
	if (len != len2)
		return 0;
	strncat(s1, s1, len);
	if (strstr(s1, s2))
		return 1;
	return 0;
}
int main()
{
	char s1[40];
	char s2[20];
	scanf("%s", s1);
	scanf("%s", s2);
	if(is_levoduct(s1, s2)==1)
	{ 
		printf("yes!\n");
	}
	else
	{
		printf("no!\n");

	}
	//ABCD
	//CDAB
	//CCAB

	return 0;
}